import request from '@/utils/request'

// 所有数据
export function prod(params) {
  return request({
    url: '/api/pds/pdsConfCategory/all',
    method: 'get',
    params
  })
}
// 产品类别树
export function productTree(params) {
  return request({
    url: '/api/pds/pdsConfCategory/getPdsConfCategoryTree',
    method: 'get',
    params
  })
}
// 获取产品类别列表
export function getDetailByName(params) {
  return request({
    url: '/api/pds/pdsConfCategory/listPdsConfCategory',
    method: 'get',
    params
  })
}
// 通过id获取详情
export function getDetailById(id) {
  return request({
    url: `/api/pds/pdsConfCategory/${id}`,
    method: 'get'
  })
}
// 新增单个对象
export function addSingleObj(data) {
  return request({
    url: '/api/pds/pdsConfCategory/addPdsConfCategory',
    method: 'post',
    data
  })
}
// 更新单个对象
export function updateDetailById(data) {
  return request({
    url: `/api/pds/pdsConfCategory/${data.id}`,
    method: 'put',
    data
  })
}

// 获取产品文档目录树
export function getDoctree(params) {
  return request({
    url: '/api/pds/pdsConfDocDirectory/get-directory-tree',
    method: 'get',
    params
  })
}
// 获取文档树单个目录节点详情
export function getDetail(params) {
  return request({
    url: 'api/pds/pdsConfDocDirectory/get-directory',
    method: 'get',
    params
  })
}
// 新增目录节点
export function addDirectory(data) {
  return request({
    url: '/api/pds/pdsConfDocDirectory/add-directory-tree',
    method: 'post',
    data
  })
}
// 修改目录节点
export function updateDirectory(data) {
  return request({
    url: '/api/pds/pdsConfDocDirectory/update-directory',
    method: 'post',
    data
  })
}
// 删除目录节点
export function handleDelete(params) {
  return request({
    url: 'api/pds/pdsConfDocDirectory/delete-directory',
    method: 'get',
    params
  })
}